using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;

namespace ConfigReader
{
    public struct AnimationStruct
    {
        public String ID;
        public List<String> Model;
        public List<CAnimation> Animation;
    }

    public class AnimationXML
    {
        private String name;
        private List<AnimationStruct> data;

        public String Name
        {
            get { return name; }
            set { name = value; }
        }
        public List<AnimationStruct> Data
        {
            get { return data; }
            set { data = value; }
        }

        #region Content Type Reader
        public class AnimationXMLReader : ContentTypeReader<AnimationXML>
        {
            protected override AnimationXML Read(ContentReader input,
                AnimationXML existingInstance)
            {
                AnimationXML animationXML = existingInstance;
                if (animationXML == null)
                {
                    animationXML = new AnimationXML();
                }

                animationXML.Name = input.ReadString();
                animationXML.Data.AddRange(input.ReadObject<List<AnimationStruct>>());

                return animationXML;
            }
        }

        #endregion

    }
}
